from drg_group.yinchuan_2023.Base import message,intersect,SS_VALID
from drg_group.yinchuan_2023.DRG import MDCL_DRG

def group(record):
  adrg_zd=["E10.200x213+N08.3*","E10.200x214+N08.3*","E10.200x215+N08.3*","E10.201+N08.3*","E11.200x023+N08.3*","E11.200x024+N08.3*","E11.200x025+N08.3*","E11.200x030+N08.3*","E11.200x031+N29.8*","E11.200x212+N08.3*","E11.200x213+N08.3*","E11.200x214+N08.3*","E11.200x215+N08.3*","E11.201+N08.3*","E11.400x381+N33.8*","E14.200x021+N08.3*","E14.200x212+N08.3*","E14.200x213+N08.3*","E14.200x214+N08.3*","E14.200x215+N08.3*","I12.900x009","M10.001+N16.8*"]
  adrg_zd1=[]
  adrg_ss=[]
  adrg_ss1=[]
  adrg_ss2=[]
  dept_list=[]
  if True and record.zdList[0] in adrg_zd:
    message('符合LV1入组条件，匹配规则：主诊断匹配')
    
    if MDCL_DRG.LV11_group(record):
      return 'LV11'

    if MDCL_DRG.LV13_group(record):
      return 'LV13'

    if MDCL_DRG.LV15_group(record):
      return 'LV15'

    return 'LV1'
  else:
    return ''

